// Sys command if compatible.

#ifndef LIGHTY_SYS_H
#define LIGHTY_SYS_H

#include <string>

#define LIGHTY_GIT_LINK "https://notabug.org/NoixDeXydre/Lighty"

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)

  #warning "Windows detected, some syscall will not work."
  const int OSID=0;
  
#elif __APPLE__

  const int OSID=1;
    
#elif __linux__ || __unix__
	
  const int OSID=2;
	
#else
  
  #warning "Unknown platform, syscalls desactivated."
  const int OSID=3;
    
#endif

void Lighty_OpenLink(std::string link){
	
  if(OSID==0){
	
    std::string post="cmd /c start ";
    std::string command=post+link;
    system(command.c_str());
    
  }
  
  else if(OSID==1){
    
    std::string post="open ";
    std::string command=post+link;
    system(command.c_str());
    
  }
    
  else if(OSID==2){
  
    std::string post="xdg-open ";
    std::string command=post+link;
    system(command.c_str());
    
  }
	
}

#endif
